package com.syh.jn.scm.domain.supplier.repository.purchase;

import com.syh.core.ddd.infrastructure.repository.AggregateRepository;
import com.syh.jn.scm.domain.supplier.entity.purchase.PurchaseReturnOrder;
import com.syh.jn.scm.domain.supplier.entity.purchase.PurchaseReturnOrderItem;

import java.util.List;

public interface PurchaseReturnOrderRepository extends PurReturnOrderReadRepository, AggregateRepository<PurchaseReturnOrder,Long> {

  /**
   * 根据id拿到明细
   *
   * @param id
   * @return
   */
  List<PurchaseReturnOrderItem> getItem(Long id);

  PurchaseReturnOrderItem getItemByItemId(Long itemId);
  /**
   * 根据id查找明细
   * @param returnOrderId
   * @return
   */
  public List<PurchaseReturnOrderItem> getItemsByPurchaseReturnOrderId(Long returnOrderId);

  /**
   * 根据ids查找明细
   * @param returnOrderIds
   * @return
   */
  public List<PurchaseReturnOrderItem> getItemsByPurchaseReturnOrderIds(Long[] returnOrderIds);

  /**
   * 取消订单
   *
   * @param purchaseReturnOrder
   */
  void cancel(PurchaseReturnOrder purchaseReturnOrder);

  /**
   * 上传图片
   * @param order
   */
  public void upload(PurchaseReturnOrder order);

  /**
   * 确认订单
   *
   * @param order
   */
  public void confirmOrder(PurchaseReturnOrder order);

  /**
   * 更新订单及订单项
   * @param order
   */
  public void updateOrderAndItems(PurchaseReturnOrder order);

  /**
   * 根据服务商id删除订单
   * @param businessEntityId
   */
  public void deleteByBusinessEntityId(Long businessEntityId);

}
